package com.ruoyi.activiti.controller;

import com.ruoyi.activiti.entity.SysForm;
import com.ruoyi.activiti.service.ISysFormService;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/form")
public class SysFormController {

    @Autowired
    private ISysFormService fromService;


    @PostMapping("/add")
    public AjaxResult addFrom(@RequestBody SysForm sysForm) {
        fromService.addFrom(sysForm);
        return AjaxResult.success();
    }

    @GetMapping("/detail")
    public AjaxResult detail(Integer id) {
        SysForm sysForm = fromService.detail(id);
        return AjaxResult.success(sysForm);
    }
}
